package cn.initcap.designpattern.pattern.structural.proxy.dynamicproxy;

import cn.initcap.designpattern.pattern.structural.proxy.IOrderService;
import cn.initcap.designpattern.pattern.structural.proxy.Order;
import cn.initcap.designpattern.pattern.structural.proxy.OrderServiceImpl;

/**
 * @author initcap
 * @date Created in 2018/9/18 AM9:44.
 */
public class Test {

    public static void main(String[] args) {
        Order order = new Order();
        order.setUserId(2);

        IOrderService orderService = (IOrderService) new OrderServiceDynamicProxy(new OrderServiceImpl()).bind();
        orderService.saveOrder(order);
    }

}
